{% extends './admin/base/base.html.twig' %}

{% block content %}
    <div class="page-title">
        <h3 class="breadcrumb-header">
            用户组详情
            {% if hasPermission('USER_GROUP_INDEX') %}
            <a href="{{ path(constant_route('USER_GROUP_INDEX')) }}" class="btn btn-primary"><i class="fa fa-undo"></i>返回</a>
            {% endif %}
        </h3>
    </div>
    <div id="main-wrapper">
        <div class="row">
            <div class="col-md-6">
                <div class="panel panel-white">
                    <div class="panel-heading">
                        <form class="form-horizontal">
                            <div class="form-group">
                                <label for="title" class="col-sm-2 control-label">用户组名称：</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" disabled value="{{ info.info.groupName }}" id="group-name">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="title" class="col-sm-2 control-label">规则名称：</label>
                                <div class="col-sm-10">
                                    <select id="role" class="form-control" multiple disabled style="height:300px">
                                        <option value="">请选择...</option>
                                        {% for role in roleList %}
                                            <option value="{{ role.id }}" {% if role.id in info.userGroupRole %}selected{% endif %} >{{ role.roleName }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="panel-body" id="permission-tree" data-load-url="">
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block js %}
    <script type="text/javascript">
        $(function () {
            loadPermission();
            $('#role').change(loadPermission);
        });
    </script>
{% endblock %}